/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "pydgtbproyec")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Pydgtbproyec.findAll", query = "SELECT p FROM Pydgtbproyec p"),
    @NamedQuery(name = "Pydgtbproyec.findByPydgtbproyecid", query = "SELECT p FROM Pydgtbproyec p WHERE p.pydgtbproyecid = :pydgtbproyecid"),
    @NamedQuery(name = "Pydgtbproyec.findByNombre", query = "SELECT p FROM Pydgtbproyec p WHERE p.nombre = :nombre"),
    @NamedQuery(name = "Pydgtbproyec.findByFechaaprobci", query = "SELECT p FROM Pydgtbproyec p WHERE p.fechaaprobci = :fechaaprobci"),
    @NamedQuery(name = "Pydgtbproyec.findByFechaaprobpp", query = "SELECT p FROM Pydgtbproyec p WHERE p.fechaaprobpp = :fechaaprobpp"),
    @NamedQuery(name = "Pydgtbproyec.findByCobertura", query = "SELECT p FROM Pydgtbproyec p WHERE p.cobertura = :cobertura"),
    @NamedQuery(name = "Pydgtbproyec.findByLocalizacion", query = "SELECT p FROM Pydgtbproyec p WHERE p.localizacion = :localizacion"),
    @NamedQuery(name = "Pydgtbproyec.findByLocgeolat", query = "SELECT p FROM Pydgtbproyec p WHERE p.locgeolat = :locgeolat"),
    @NamedQuery(name = "Pydgtbproyec.findByLocgeolong", query = "SELECT p FROM Pydgtbproyec p WHERE p.locgeolong = :locgeolong"),
    @NamedQuery(name = "Pydgtbproyec.findByLocpuntcarlat", query = "SELECT p FROM Pydgtbproyec p WHERE p.locpuntcarlat = :locpuntcarlat"),
    @NamedQuery(name = "Pydgtbproyec.findByLocpuntcarlong", query = "SELECT p FROM Pydgtbproyec p WHERE p.locpuntcarlong = :locpuntcarlong"),
    @NamedQuery(name = "Pydgtbproyec.findByEmail", query = "SELECT p FROM Pydgtbproyec p WHERE p.email = :email"),
    @NamedQuery(name = "Pydgtbproyec.findByWeb", query = "SELECT p FROM Pydgtbproyec p WHERE p.web = :web"),
    @NamedQuery(name = "Pydgtbproyec.findByDuracion", query = "SELECT p FROM Pydgtbproyec p WHERE p.duracion = :duracion"),
    @NamedQuery(name = "Pydgtbproyec.findByFecharegistro", query = "SELECT p FROM Pydgtbproyec p WHERE p.fecharegistro = :fecharegistro"),
    @NamedQuery(name = "Pydgtbproyec.findByObservaciones", query = "SELECT p FROM Pydgtbproyec p WHERE p.observaciones = :observaciones"),
    @NamedQuery(name = "Pydgtbproyec.findByImpacto", query = "SELECT p FROM Pydgtbproyec p WHERE p.impacto = :impacto"),
    @NamedQuery(name = "Pydgtbproyec.findByFin", query = "SELECT p FROM Pydgtbproyec p WHERE p.fin = :fin"),
    @NamedQuery(name = "Pydgtbproyec.findByLineabase", query = "SELECT p FROM Pydgtbproyec p WHERE p.lineabase = :lineabase")})
public class Pydgtbproyec implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "pydgtbproyecid")
    private Integer pydgtbproyecid;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 800)
    @Column(name = "nombre")
    private String nombre;
    @Column(name = "fechaaprobci")
    @Temporal(TemporalType.DATE)
    private Date fechaaprobci;
    @Column(name = "fechaaprobpp")
    @Temporal(TemporalType.DATE)
    private Date fechaaprobpp;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 600)
    @Column(name = "cobertura")
    private String cobertura;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 600)
    @Column(name = "localizacion")
    private String localizacion;
    @Basic(optional = false)
    @NotNull
    @Column(name = "locgeolat")
    private int locgeolat;
    @Basic(optional = false)
    @NotNull
    @Column(name = "locgeolong")
    private int locgeolong;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 1)
    @Column(name = "locpuntcarlat")
    private String locpuntcarlat;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 1)
    @Column(name = "locpuntcarlong")
    private String locpuntcarlong;
    // @Pattern(regexp="[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?", message="Invalid email")//if the field contains email address consider using this annotation to enforce field validation
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "email")
    private String email;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 400)
    @Column(name = "web")
    private String web;
    @Basic(optional = false)
    @NotNull
    @Column(name = "duracion")
    private int duracion;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fecharegistro")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecharegistro;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "observaciones")
    private String observaciones;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 800)
    @Column(name = "impacto")
    private String impacto;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 500)
    @Column(name = "fin")
    private String fin;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 500)
    @Column(name = "lineabase")
    private String lineabase;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "pydgtbproyecid")
    private Collection<Pydgtbregfoto> pydgtbregfotoCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "pydgtbproyecid")
    private Collection<Scrvtbrepubrev> scrvtbrepubrevCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "pydgtbproyecid")
    private Collection<Pyfntbactiproy> pyfntbactiproyCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "pydgtbproyecid")
    private Collection<Pydgtbproydoc> pydgtbproydocCollection;
    @JoinColumn(name = "scittbfadeceid", referencedColumnName = "scittbfadeceid")
    @ManyToOne(optional = false)
    private Scittbfadece scittbfadeceid;
    @JoinColumn(name = "revisionparesid", referencedColumnName = "scintborganismid")
    @ManyToOne(optional = false)
    private Scintborganism revisionparesid;
    @JoinColumn(name = "scaltbtipoinvid", referencedColumnName = "scaltbtipoinvid")
    @ManyToOne(optional = false)
    private Scaltbtipoinv scaltbtipoinvid;
    @JoinColumn(name = "scaltblineinveid", referencedColumnName = "scaltblineinveid")
    @ManyToOne(optional = false)
    private Scaltblineinve scaltblineinveid;
    @JoinColumn(name = "pydgtbtipoproyid", referencedColumnName = "pydgtbtipoproyid")
    @ManyToOne(optional = false)
    private Pydgtbtipoproy pydgtbtipoproyid;
    @JoinColumn(name = "pydgtbetapejecid", referencedColumnName = "pydgtbetapejecid")
    @ManyToOne(optional = false)
    private Pydgtbetapejec pydgtbetapejecid;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "pydgtbproyecid")
    private Collection<Pydgtbinf> pydgtbinfCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "pydgtbproyecid")
    private Collection<Pydgtbaresene> pydgtbareseneCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "pydgtbproyecid")
    private Collection<Pydgtbresponsa> pydgtbresponsaCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "pydgtbproyecid")
    private Collection<Pydgtbinvanual> pydgtbinvanualCollection;

    public Pydgtbproyec() {
    }

    public Pydgtbproyec(Integer pydgtbproyecid) {
        this.pydgtbproyecid = pydgtbproyecid;
    }

    public Pydgtbproyec(Integer pydgtbproyecid, String nombre, String cobertura, String localizacion, int locgeolat, int locgeolong, String locpuntcarlat, String locpuntcarlong, String email, String web, int duracion, Date fecharegistro, String observaciones, String impacto, String fin, String lineabase) {
        this.pydgtbproyecid = pydgtbproyecid;
        this.nombre = nombre;
        this.cobertura = cobertura;
        this.localizacion = localizacion;
        this.locgeolat = locgeolat;
        this.locgeolong = locgeolong;
        this.locpuntcarlat = locpuntcarlat;
        this.locpuntcarlong = locpuntcarlong;
        this.email = email;
        this.web = web;
        this.duracion = duracion;
        this.fecharegistro = fecharegistro;
        this.observaciones = observaciones;
        this.impacto = impacto;
        this.fin = fin;
        this.lineabase = lineabase;
    }

    public Integer getPydgtbproyecid() {
        return pydgtbproyecid;
    }

    public void setPydgtbproyecid(Integer pydgtbproyecid) {
        this.pydgtbproyecid = pydgtbproyecid;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public Date getFechaaprobci() {
        return fechaaprobci;
    }

    public void setFechaaprobci(Date fechaaprobci) {
        this.fechaaprobci = fechaaprobci;
    }

    public Date getFechaaprobpp() {
        return fechaaprobpp;
    }

    public void setFechaaprobpp(Date fechaaprobpp) {
        this.fechaaprobpp = fechaaprobpp;
    }

    public String getCobertura() {
        return cobertura;
    }

    public void setCobertura(String cobertura) {
        this.cobertura = cobertura;
    }

    public String getLocalizacion() {
        return localizacion;
    }

    public void setLocalizacion(String localizacion) {
        this.localizacion = localizacion;
    }

    public int getLocgeolat() {
        return locgeolat;
    }

    public void setLocgeolat(int locgeolat) {
        this.locgeolat = locgeolat;
    }

    public int getLocgeolong() {
        return locgeolong;
    }

    public void setLocgeolong(int locgeolong) {
        this.locgeolong = locgeolong;
    }

    public String getLocpuntcarlat() {
        return locpuntcarlat;
    }

    public void setLocpuntcarlat(String locpuntcarlat) {
        this.locpuntcarlat = locpuntcarlat;
    }

    public String getLocpuntcarlong() {
        return locpuntcarlong;
    }

    public void setLocpuntcarlong(String locpuntcarlong) {
        this.locpuntcarlong = locpuntcarlong;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getWeb() {
        return web;
    }

    public void setWeb(String web) {
        this.web = web;
    }

    public int getDuracion() {
        return duracion;
    }

    public void setDuracion(int duracion) {
        this.duracion = duracion;
    }

    public Date getFecharegistro() {
        return fecharegistro;
    }

    public void setFecharegistro(Date fecharegistro) {
        this.fecharegistro = fecharegistro;
    }

    public String getObservaciones() {
        return observaciones;
    }

    public void setObservaciones(String observaciones) {
        this.observaciones = observaciones;
    }

    public String getImpacto() {
        return impacto;
    }

    public void setImpacto(String impacto) {
        this.impacto = impacto;
    }

    public String getFin() {
        return fin;
    }

    public void setFin(String fin) {
        this.fin = fin;
    }

    public String getLineabase() {
        return lineabase;
    }

    public void setLineabase(String lineabase) {
        this.lineabase = lineabase;
    }

    @XmlTransient
    public Collection<Pydgtbregfoto> getPydgtbregfotoCollection() {
        return pydgtbregfotoCollection;
    }

    public void setPydgtbregfotoCollection(Collection<Pydgtbregfoto> pydgtbregfotoCollection) {
        this.pydgtbregfotoCollection = pydgtbregfotoCollection;
    }

    @XmlTransient
    public Collection<Scrvtbrepubrev> getScrvtbrepubrevCollection() {
        return scrvtbrepubrevCollection;
    }

    public void setScrvtbrepubrevCollection(Collection<Scrvtbrepubrev> scrvtbrepubrevCollection) {
        this.scrvtbrepubrevCollection = scrvtbrepubrevCollection;
    }

    @XmlTransient
    public Collection<Pyfntbactiproy> getPyfntbactiproyCollection() {
        return pyfntbactiproyCollection;
    }

    public void setPyfntbactiproyCollection(Collection<Pyfntbactiproy> pyfntbactiproyCollection) {
        this.pyfntbactiproyCollection = pyfntbactiproyCollection;
    }

    @XmlTransient
    public Collection<Pydgtbproydoc> getPydgtbproydocCollection() {
        return pydgtbproydocCollection;
    }

    public void setPydgtbproydocCollection(Collection<Pydgtbproydoc> pydgtbproydocCollection) {
        this.pydgtbproydocCollection = pydgtbproydocCollection;
    }

    public Scittbfadece getScittbfadeceid() {
        return scittbfadeceid;
    }

    public void setScittbfadeceid(Scittbfadece scittbfadeceid) {
        this.scittbfadeceid = scittbfadeceid;
    }

    public Scintborganism getRevisionparesid() {
        return revisionparesid;
    }

    public void setRevisionparesid(Scintborganism revisionparesid) {
        this.revisionparesid = revisionparesid;
    }

    public Scaltbtipoinv getScaltbtipoinvid() {
        return scaltbtipoinvid;
    }

    public void setScaltbtipoinvid(Scaltbtipoinv scaltbtipoinvid) {
        this.scaltbtipoinvid = scaltbtipoinvid;
    }

    public Scaltblineinve getScaltblineinveid() {
        return scaltblineinveid;
    }

    public void setScaltblineinveid(Scaltblineinve scaltblineinveid) {
        this.scaltblineinveid = scaltblineinveid;
    }

    public Pydgtbtipoproy getPydgtbtipoproyid() {
        return pydgtbtipoproyid;
    }

    public void setPydgtbtipoproyid(Pydgtbtipoproy pydgtbtipoproyid) {
        this.pydgtbtipoproyid = pydgtbtipoproyid;
    }

    public Pydgtbetapejec getPydgtbetapejecid() {
        return pydgtbetapejecid;
    }

    public void setPydgtbetapejecid(Pydgtbetapejec pydgtbetapejecid) {
        this.pydgtbetapejecid = pydgtbetapejecid;
    }

    @XmlTransient
    public Collection<Pydgtbinf> getPydgtbinfCollection() {
        return pydgtbinfCollection;
    }

    public void setPydgtbinfCollection(Collection<Pydgtbinf> pydgtbinfCollection) {
        this.pydgtbinfCollection = pydgtbinfCollection;
    }

    @XmlTransient
    public Collection<Pydgtbaresene> getPydgtbareseneCollection() {
        return pydgtbareseneCollection;
    }

    public void setPydgtbareseneCollection(Collection<Pydgtbaresene> pydgtbareseneCollection) {
        this.pydgtbareseneCollection = pydgtbareseneCollection;
    }

    @XmlTransient
    public Collection<Pydgtbresponsa> getPydgtbresponsaCollection() {
        return pydgtbresponsaCollection;
    }

    public void setPydgtbresponsaCollection(Collection<Pydgtbresponsa> pydgtbresponsaCollection) {
        this.pydgtbresponsaCollection = pydgtbresponsaCollection;
    }

    @XmlTransient
    public Collection<Pydgtbinvanual> getPydgtbinvanualCollection() {
        return pydgtbinvanualCollection;
    }

    public void setPydgtbinvanualCollection(Collection<Pydgtbinvanual> pydgtbinvanualCollection) {
        this.pydgtbinvanualCollection = pydgtbinvanualCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (pydgtbproyecid != null ? pydgtbproyecid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Pydgtbproyec)) {
            return false;
        }
        Pydgtbproyec other = (Pydgtbproyec) object;
        if ((this.pydgtbproyecid == null && other.pydgtbproyecid != null) || (this.pydgtbproyecid != null && !this.pydgtbproyecid.equals(other.pydgtbproyecid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Pydgtbproyec[ pydgtbproyecid=" + pydgtbproyecid + " ]";
    }
    
}
